import request from '@/utils/request'

// 查询商城优惠券活动列表
export function listCouponActivity(query) {
  return request({
    url: '/manager/promotion/coupon/activity/list',
    method: 'get',
    params: query
  })
}

// 查询商城优惠券详细
export function getCouponActivity(id) {
  return request({
    url: '/manager/promotion/coupon/activity/' + id,
    method: 'get'
  })
}

// 新增商城优惠券
export function addCouponActivity(data) {
  return request({
    url: '/manager/promotion/coupon/activity',
    method: 'post',
    data: data
  })
}

// 修改商城优惠券
export function updateCouponActivity(data) {
  return request({
    url: '/manager/promotion/coupon/activity',
    method: 'put',
    data: data
  })
}

// 删除商城优惠券
export function delCouponActivity(id) {
  return request({
    url: '/manager/promotion/coupon/activity/' + id,
    method: 'delete'
  })
}

// 启用商城优惠券
export function enableCouponActivity(id) {
  return request({
    url: '/manager/promotion/coupon/activity/enable/' + id,
    method: 'post'
  })
}

// 关闭商城优惠券
export function closeCoupon(ids) {
  return request({
    url: '/manager/promotion/coupon/activity/close/' + ids,
    method: 'post'
  })
}
